const expect=require('chai').expect;


describe('property',()=>{
    it('继承属性',()=>{
        expect({a:1}).property('toString');
    });

    it('本地属性',()=>{
        expect({a:1}).property('a');
    });

    it('本地不可枚举属性',()=>{
        let obj={};
        Object.defineProperty(obj,'a',{
            value:'A',
            enumerable:false
        });
        console.log('obj:',obj);
        expect(obj).property('a');
    });

    it('属性值-基本类型',()=>{
        expect({a:1,b:2}).property('b',2);
    });

    it('属性值-复合类型',()=>{
        expect({a:1,b:[1,2]}).property('b',[1,2]);
    });

    it('属性值-相等',()=>{
        expect({a:1,b:2}).property('b','2');
    });
});

describe('deep.property',()=>{
    it('数组',()=>{
        expect([1,2]).property('[0]',1);
    });
});